package grp.controller;
import grp.pojo.Consumer;
import grp.service.IConsumerService;
import org.springframework.stereotype.Controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/consumer/")
public class ConsumerController {
    @Autowired
    private IConsumerService iConsumerService;

    @RequestMapping(value = "getNameByID.do",method = RequestMethod.POST)
    @ResponseBody
    public String getNameByID(String id){
        Consumer obj = iConsumerService.getNameByID(id);
        if (obj == null){
            return "查无此人";
        }
        return obj.getName();
    }
}
